﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;

namespace File_Manager.Models
{
    public class CYTInitializer : DropCreateDatabaseIfModelChanges<CYTContext>
    //public class CYTInitializer : DropCreateDatabaseAlways<CYTContext>
    {
        protected override void Seed(CYTContext context)
        {
            var turno = new List<Turno> {  
                 new Turno { name="Viernes (2:30pm - 7:30pm)" },
                 new Turno { name="Sabado (8:00am - 1:00pm)" }
             };

            turno.ForEach(d => context.Turno.Add(d));

            var sede = new List<Sede> {  
                 new Sede { name="Instituto Educacional 'San Antonio'" },
                 new Sede { name="Unidad Educativa Colegio 'Dr. José María Vargas'" }
             };

            sede.ForEach(d => context.Sede.Add(d));

            var modopago = new List<ModoPago> {  
                 new ModoPago { name="Contado (inscripción)", n_cuotas=1, exp_date02=null, exp_date03=null},
                 new ModoPago { name="Dos Cuotas ( inscripción, diciembre)", n_cuotas=2, exp_date02=new DateTime(2014,12,06,00,00,00,000), exp_date03=null },
                 new ModoPago { name="Tres Cuotas ( inscripción, noviembre, diciembre)", n_cuotas=3, exp_date02=new DateTime(2014,11,08,00,00,00,000), exp_date03=new DateTime(2014,12,06,00,00,00,000) }
             };

            modopago.ForEach(d => context.ModoPago.Add(d));

            var status = new List<Status> {  
                 new Status { name="Pendiente" },
                 new Status { name="Aprobado" },
                 new Status { name="Bloqueado" },
                 new Status { name="Rechazado" }
             };

            status.ForEach(d => context.Status.Add(d));

            var rol = new List<Rol> {  
                 new Rol { idRol="Guest_C", name="Ciencias de la Salud" },
                 new Rol { idRol="Guest_H", name="Humanidades y Sociales" },
                 new Rol { idRol="Guest_I", name="Ingeniería y Ciencias Básicas" }
             };

            rol.ForEach(d => context.Rol.Add(d));

            var formapago = new List<FormaPago> {  
                 new FormaPago { name="Depósito Bancario" },
                 new FormaPago { name="Transferencia Bancaria" }
             };

            formapago.ForEach(d => context.FormaPago.Add(d));

            var formapago02 = new List<FormaPago02> {  
                 new FormaPago02 { name="Depósito Bancario (2da Cuota)" },
                 new FormaPago02 { name="Transferencia Bancaria (2da Cuota)" }
             };

            formapago02.ForEach(d => context.FormaPago02.Add(d));

            var formapago03 = new List<FormaPago03> {  
                 new FormaPago03 { name="Depósito Bancario (3era Cuota)" },
                 new FormaPago03 { name="Transferencia Bancaria (3era Cuota)" }
             };

            formapago03.ForEach(d => context.FormaPago03.Add(d));
            /*
            var user_i = new List<User_I> {  
                 new User_I { UserName="14753692", registerDate= new DateTime(2014,05,01,00,00,00,000), name="Jorge Ramón", last_name="Villega Jaimes", phone="0414-3577896", career="Ing. Electrica", zone="Caracas", school="U.E Leoncio Pilatos", parent_name="Jaime Emilio", parent_last_name="Rincón Pererira", parent_cedula="5123698", parent_phone="0426-3578963", parent_email="jtoyen@hotmail.com", idTurno=1, idSede=1, idStatus=2, idRol="Guest_C", idModoPago=1, n_cuotas_pago=1, idFormaPago=1, n_transaction="DEP-012153", transactionDate= new DateTime(2014,05,01,00,00,00,000), verificado="SI", idFormaPago02=1, n_transaction02=null, transactionDate02=null, verificado02=null, idFormaPago03=1, n_transaction03=null, transactionDate03=null, verificado03=null },
                 new User_I { UserName="17458963", registerDate= new DateTime(2014,05,02,00,00,00,000), name="Jessica Erika", last_name="Gómez Galindo", phone="0412-7458596", career="Ing. Quimica", zone="Guaira", school="U.E Eglia Tovar", parent_name="Judy Elena", parent_last_name="Perez Bonilla", parent_cedula="6578963", parent_phone="0421-1478523", parent_email="edrte@hotmail.com", idTurno=2, idSede=2, idStatus=1, idRol="Guest_I", idModoPago=3, n_cuotas_pago=2, idFormaPago=1, n_transaction="DEP-0115", transactionDate= new DateTime(2014,05,02,00,00,00,000), verificado="SI", idFormaPago02=2, n_transaction02="TRANS-14593", transactionDate02=new DateTime(2014,05,05,00,00,00,000), verificado02="NO", idFormaPago03=1, n_transaction03=null, transactionDate03=null, verificado03=null },
                 new User_I { UserName="5123369", registerDate= new DateTime(2014,05,04,00,00,00,000), name="Astrid Maria", last_name="Jaimes Gonzales", phone="0416-1452368", career="Lic. Quimica", zone="San Antonio", school="U.E UEDTEr", parent_name="Carla Maria", parent_last_name="Bencomo Torres", parent_cedula="4587963", parent_phone="0426-6891475", parent_email="hyioo@hotmail.com", idTurno=2, idSede=2, idStatus=2, idRol="Guest_C", idModoPago=3, n_cuotas_pago=2, idFormaPago=1, n_transaction="DEP-04174", transactionDate= new DateTime(2014,05,04,00,00,00,000), verificado="SI", idFormaPago02=2, n_transaction02="TRANS-1475275", transactionDate02=new DateTime(2014,05,08,00,00,00,000), verificado02="SI", idFormaPago03=1, n_transaction03=null, transactionDate03=null, verificado03=null },
                 new User_I { UserName="6458790", registerDate= new DateTime(2014,05,15,00,00,00,000), name="Mireya Carl", last_name="Gonzales Reina", phone="0416-1452368", career="Lic. Matematicas", zone="Los Teques", school="U.E GHHURE", parent_name="Jessica Maria", parent_last_name="Gonzales Perez", parent_cedula="2589634", parent_phone="0416-1472598", parent_email="asweyi@hotmail.com", idTurno=1, idSede=2, idStatus=2, idRol="Guest_C", idModoPago=3, n_cuotas_pago=1, idFormaPago=1, n_transaction="DEP-6241", transactionDate= new DateTime(2014,05,15,00,00,00,000), verificado="SI", idFormaPago02=1, n_transaction02=null, transactionDate02=null, verificado02=null, idFormaPago03=1, n_transaction03=null, transactionDate03=null, verificado03=null },
                 new User_I { UserName="11547896", registerDate= new DateTime(2014,05,20,00,00,00,000), name="Jonas Enrique", last_name="Mariño Torres", phone="0412-2583410", career="Ing. Computación", zone="Pereria Zona", school="U.E YUIOT", parent_name="Tereza Petra", parent_last_name="Ramires Blanco", parent_cedula="9856631", parent_phone="0424-1475863", parent_email="gqeds@hotmail.com", idTurno=1, idSede=1, idStatus=2, idRol="Guest_I", idModoPago=2, n_cuotas_pago=2, idFormaPago=1, n_transaction="DEP-444577", transactionDate= new DateTime(2014,05,20,00,00,00,000), verificado="SI", idFormaPago02=2, n_transaction02="TRANS-779645", transactionDate02=new DateTime(2014,05,25,00,00,00,000), verificado02="SI", idFormaPago03=1, n_transaction03=null, transactionDate03=null, verificado03=null },
                 new User_I { UserName="9236093", registerDate= new DateTime(2014,05,10,00,00,00,000), name="Enrique", last_name="Mariño", phone="0414-8964551", career="Computación", zone="Militari Zona", school="U.E DESRT", parent_name="Tereza", parent_last_name="Blanco", parent_cedula="5421789", parent_phone="0412-1453289", parent_email="gyuoa@hotmail.com", idTurno=2, idSede=2, idStatus=3, idRol="Guest_C", idModoPago=3, n_cuotas_pago=2, idFormaPago=1, n_transaction="DEP-67856", transactionDate= new DateTime(2014,05,10,00,00,00,000), verificado="SI", idFormaPago02=2, n_transaction02="TRANS-23423", transactionDate02=new DateTime(2014,05,25,00,00,00,000), verificado02="NO", idFormaPago03=1, n_transaction03=null, transactionDate03=null, verificado03=null },
                 new User_I { UserName="18546933", registerDate= new DateTime(2014,05,17,00,00,00,000), name="Jose", last_name="Marquina", phone="0416-1493652", career="Lic. Artes", zone="Valles del Tuy", school="U.E UOTYR", parent_name="Maria", parent_last_name="Bolívar", parent_cedula="3698521", parent_phone="0426-6358741", parent_email="6ytw@hotmail.com", idTurno=1, idSede=1, idStatus=1, idRol="Guest_H", idModoPago=3, n_cuotas_pago=3, idFormaPago=1, n_transaction="DEP-234234", transactionDate= new DateTime(2014,05,17,00,00,00,000), verificado="SI", idFormaPago02=2, n_transaction02="TRANS-34888", transactionDate02=new DateTime(2014,05,22,00,00,00,000), verificado02="SI", idFormaPago03=1, n_transaction03="DEP-65486", transactionDate03=new DateTime(2014,05,27,00,00,00,000), verificado03="SI" },
                 new User_I { UserName="6589741", registerDate= new DateTime(2014,05,12,00,00,00,000), name="Alberto", last_name="Peralta Raisa", phone="0412-4562013", career="Lic. RRHH", zone="Tuy", school="U.E GUOES", parent_name="Alejandra", parent_last_name="Enriqueta", parent_cedula="4567921", parent_phone="0424-6279032", parent_email="8ured@hotmail.com", idTurno=2, idSede=2, idStatus=2, idRol="Guest_H", idModoPago=3, n_cuotas_pago=3, idFormaPago=1, n_transaction="DEP-453645", transactionDate= new DateTime(2014,05,12,00,00,00,000), verificado="SI", idFormaPago02=2, n_transaction02="TRANS-45645", transactionDate02=new DateTime(2014,05,22,00,00,00,000), verificado02="SI", idFormaPago03=1, n_transaction03="DEP-234234", transactionDate03=new DateTime(2014,05,27,00,00,00,000), verificado03="NO" },
                 new User_I { UserName="14258963", registerDate= new DateTime(2014,05,07,00,00,00,000), name="Roberto", last_name="Raisa Manrique", phone="0426-6579243", career="Lic. Mécanica", zone="Edo.Arauga", school="U.E JOGU", parent_name="Erika Bella", parent_last_name=" Solano Enriqueta", parent_cedula="5123456", parent_phone="0424-1478523", parent_email="5deff@hotmail.com", idTurno=1, idSede=1, idStatus=2, idRol="Guest_I", idModoPago=1, n_cuotas_pago=1, idFormaPago=1, n_transaction="DEP-23423", transactionDate= new DateTime(2014,05,07,00,00,00,000), verificado="SI", idFormaPago02=1, n_transaction02=null, transactionDate02=null, verificado02=null, idFormaPago03=1, n_transaction03=null, transactionDate03=null, verificado03=null }
              };

            user_i.ForEach(d => context.User_I.Add(d));*/

            var mail = new List<Mail> {  
                 new Mail { name="di_puglia_29@hotmail.com,dipuglia29.88@gmail.com" }
             };

            mail.ForEach(d => context.Mail.Add(d));

            /************************************************************************************************************/
            /**********************          DECLARACIÓN DEL MODELO CRECE Y TRIUNFA MÓDULO 3        *********************/
            /************************************************************************************************************/
            /*** Tablas:                                                                                              ***/
            /***        Estado.dbo                                                                                    ***/
            /***        Materia.dbo                                                                                   ***/
            /***        Etapa.dbo                                                                                     ***/
            /***                                                                                                      ***/
            /************************************************************************************************************/

            var estado = new List<Estado> {  
                 new Estado { name="Activo" },
                 new Estado { name="Inactivo" },
                 new Estado { name="Cerrado" }
             };

            estado.ForEach(d => context.Estado.Add(d));

            var etapa = new List<Etapa> {  
                 new Etapa { name="Primera Etapa" },
                 new Etapa { name="Segunda Etapa" }
             };

            etapa.ForEach(d => context.Etapa.Add(d));


            var materia_1 = new List<Materia_1> {  
                 new Materia_1 { name="Matemáticas" },
                 new Materia_1 { name="Verbal" },
                 new Materia_1 { name="Lógica" },
                 new Materia_1 { name="Abstracto" },
                 new Materia_1 { name="Física" },
                 new Materia_1 { name="Química" },
                 new Materia_1 { name="Biología" }
             };

            materia_1.ForEach(d => context.Materia_1.Add(d));

            var materia_2 = new List<Materia_2> {  
                 new Materia_2 { name="Matemáticas" },
                 new Materia_2 { name="Verbal" },
                 new Materia_2 { name="Lógica" },
                 new Materia_2 { name="Abstracto" },
                 new Materia_2 { name="Física" },
                 new Materia_2 { name="Química" },
                 new Materia_2 { name="Biología" }
             };

            materia_2.ForEach(d => context.Materia_2.Add(d));

            var materia_3 = new List<Materia_3> {  
                 new Materia_3 { name="Matemáticas" },
                 new Materia_3 { name="Verbal" },
                 new Materia_3 { name="Lógica" },
                 new Materia_3 { name="Abstracto" },
                 new Materia_3 { name="Física" },
                 new Materia_3 { name="Química" },
                 new Materia_3 { name="Biología" }
             };

            materia_3.ForEach(d => context.Materia_3.Add(d));

            context.SaveChanges();
        }

    }
}